<?php

namespace App\Repositories;

use App\Models\TestingResultType;
use Cache;
class TestingRecommendProductRepository extends Repository
{
    static $tag = 'testing.result.product';


    public function getById($id)
    {
        $cacheKey = getCacheKey('testing.cache_key.recommend_product.info') . $id;
        $value = $this->remember($cacheKey, function () use ($id) {
            return TestingResultType::where('id', $id)->first();
        });
        return $value;
    }



    public function cacheTime()
    {
        return config('testing.common_cache_time');
    }


    public function model()
    {
        return app(TestingResultType::class);
    }

    public function tag()
    {
        return self::$tag;
    }
}